package com.mikao.constant;

/**
 * 错误码枚举类
 *
 * @author KennyDavid
 */
public enum ErrorCode {
    /**
     * 操作成功
     */
    SUCCESS(200, "success"),

    /**
     * 未知错误
     */
    FAILURE(500, "未知错误"),

    /**
     * OPENID获取失败
     */
    OPEN_ID_ERROR(1001, "OPENID获取失败！"),

    /**
     * 用户不存在
     */
    USER_NOT_EXIT(1002, "用户不存在！"),

    /**
     * 获取手机号失败
     */
    GET_PHONE_ERROR(1006, "获取手机号失败！"),

    /**
     * 手机验证码错误
     */
    PHONE_CODE_ERROR(1008, "手机验证码错误！"),

    /**
     * 内容为空
     */
    NULL_CONTENT(1009, "内容为空"),

    /**
     * 已经领取过该优惠券
     */
    GOTTED_TICKET(1010, "已经领取过该优惠券"),

    /**
     * 积分不足
     */
    POINT_NOT_ENOUGH(1011, "积分不足"),
    /**
     * 参数错误
     */
    PARAM_ERROR(600, "参数错误");


    private Integer code;
    private String msg;

    ErrorCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
